package com.transaction.simulate.mapper;


import com.transaction.common.base.PageInfo;
import com.transaction.simulate.model.dto.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface TransMapper {

    void generateChannelTransData(@Param("channelTransList") List<ChannelTrans> channelTransList);

    List<ChannelTrans> getChannelTrans(@Param("channelTrans") ChannelTrans channelTrans,
                                       @Param("pageInfo") PageInfo pageInfo);

    List<Map<String, Object>> getTransToMap(@Param("channelCode") String channelCode,
                                            @Param("dateRange") List<String> dateRange);

    void updateChannelTrans(@Param("channelCode") String channelCode,
                            @Param("dataList") List<Map<String, Object>> dataList);

    void insertChannelTrans(@Param("channelCode") String channelCode,
                            @Param("dataList") List<Map<String, Object>> dataList);

    void deleteChannelTrans(@Param("channelCode") String channelCode,
                            @Param("dataList") List<Map<String, Object>> dataList);

    void deleteReconciliation(@Param("channelCode") String channelCode,
                              @Param("transactionCfmDate") String transactionCfmDate);

    void insertReconciliation(@Param("channelCode") String channelCode,
                              @Param("dataList") List<Map<String, Object>> dataList);

    void deleteBonus(@Param("channelCode") String channelCode,
                     @Param("dividentDate") String dividentDate);

    void insertBonus(@Param("channelCode") String channelCode,
                     @Param("dataList") List<Map<String, Object>> dataList);

    List<Reconciliation> getReconciliation(@Param("reconciliation") Reconciliation reconciliation,
                                           @Param("pageInfo") PageInfo pageInfo);

    List<Bonus> getBonus(@Param("bonus") Bonus bonus,
                         @Param("pageInfo") PageInfo pageInfo);

    List<ElContract> getElContract(@Param("elContract") ElContract elContract, @Param("pageInfo") PageInfo pageInfo);

    @Update("truncate table t_channelTrans")
    void deleteAll();

    @Update("truncate table t_elContract")
    void deleteAllElContract();

    void insertChannelTransConfirm(@Param("channelCode") String channelCode,
                                   @Param("dataList") List<Map<String, Object>> dataList);

    List<ChannelTransCfm> getChannelTransCfm(ChannelTransCfm  channelTransCfm);

    @Update("truncate table t_channelTransConfirm")
    void deleteAllChannelTransCfm();

    List<TransVolStatistics> selectTransData(TransVolStatistics transVolStatistics);

    List<TransVolStatistics> selectTransCfmData(TransVolStatistics transVolStatistics);

    List<TransVolStatistics> selectBonusData(TransVolStatistics transVolStatistics);

    List<TransVolStatistics> selectReconciliationData(TransVolStatistics transVolStatistics);
}
